package br.com.gsa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.gsa.bean.dao.DaoGenerico;
import br.com.gsa.model.Task;
import br.com.gsa.service.TaskService;

@Service(value="taskService")
public class TaskServiceImpl implements TaskService{

	//@Autowired
	private DaoGenerico<Task> taskDao;
	
	
	@SuppressWarnings("unused")
	private void TAks() {
		taskDao.setPersistentClass(Task.class);
	}
	
	public void save(Task task) {
		taskDao.save(task);
	}

	public List<Task> recuperaTasks() {
		taskDao.setPersistentClass(Task.class);
		return taskDao.findAll();
	}

	public void update(Task task){
		taskDao.update(task);
	}

	public void deleteById(Long id) {
		taskDao.setPersistentClass(Task.class);
		taskDao.deleteById(id);
	}
	
	
	
}
